<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <head>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
  <script type="text/javascript" src="jquery-1.9.1.min.js">
  </script>
  <style>
  div{
  border:1px solid #cccccc;
  }
  </style>
 </head>

 <body>

选项
<input type="checkbox" name="love[]" value="book1" checked="checked" />1
<input type="checkbox" name="love[]" value="book2" />2
<input type="checkbox" name="love[]" value="book3" />3
<input type="checkbox" name="love[]" value="book4" />4
<a href="#" id="check_all">全选</a>
<a href="#" id="check_fx">反选</a>
<a href="#" id="check_qx">取消选择</a>


</body>


<script type="text/javascript">

$("#check_all").click(function(){
	
$("input[name='love[]']").each(function(){
			this.checked =true;
	});
});

$("#check_qx").click(function(){
		$("input[name='love[]']").each(function(){
			this.checked =false;
		});
});

$("#check_fx").click(function(){
	$("input[name='love[]']").each(function(){
		if(this.checked==true){

			this.checked = false;
		}else{

			this.checked = true;
		}
	});
});

</script>


</HTML>
